In graph theory, a branch of mathematics, the rank of an undirected graph is defined as the number n − c, where n is the number of vertices and c is the number of connected components of the graph. Equivalently, the rank of a graph is the rank of the oriented incidence matrix associated with the graph.
Analogously, the nullity of an undirected graph is the nullity of its incidence matrix, given by the formula m − n + c, where n and c are as above and m is the number of edges in the graph. The nullity is equal to the first Betti number of the graph. The sum of the rank and the nullity is the number of edges.